<!DOCTYPE html>
<html lang="en">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	String basePathCl = request.getScheme()+"://"+request.getServerName()+path+"/";
%>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>合伙人定金支付</title>
<script src="<%=basePath%>weixin/js/mui.min.js"></script>
<script src="<%=basePath%>weixin/js/jquery.min.js"></script>
<link rel="stylesheet" href="<%=basePath%>weixin/css/mui.min.css" />

<link rel="stylesheet" href="<%=basePath%>weixin/css/base.css" />
<link rel="stylesheet" href="<%=basePath%>weixin/css/style.css" />
<script src="<%=basePath%>weixin/js/page/common.js"></script>
<!-- 微信分享 -->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="<%=basePath%>weixin/js/page/share.js"></script>
<script src="<%=basePath%>weixin/js/jquery.sha1.js"></script>
<script type="text/javascript">
	common.setSize();
</script>
<style type="text/css">
	.pay{width: 100%; padding-top: 5px;}
	.pay .pay_item{display: table; width: 100%; border-bottom: 1px solid rgb(228,228,228); padding: 15px 0;}
	.pay .pay_item > div{display:table-cell;}
	.pay .pay_item .pay_item_1{width: 50%; min-width: 150px; padding-left: 30px;}
	.pay .pay_item.noborder{border: 0 !important;}
	.pay #submit{padding: 15px 0; margin-top: 10px;}
	.pay #submit a{ padding: 15px 0; display: block; text-align: center; margin: 0 20px; border-radius: 5px; color: #fff; font-size: 20px; text-decoration: none;}
	.usable {background: #57ce1c;}
	.forbidden { background: rgb(155,155,155); }
</style>
</head>
<body>
    <form id="bargainForm" >
	<div class="pay">
		<input type="hidden" id="user_id" name="user_id" value="${serviceInfo.sid}"/>
		<input type="hidden" id="pay_name" name="pay_name" value="${serviceInfo.nickname}" />
		<input type="hidden" id="pay_tel" name="pay_tel" value="${serviceInfo.tel}" />
		<input type="hidden" id="total_fee" name="total_fee" />
		<div class="pay_item">
			<div class="pay_item_1">
				<strong>收款方信息</strong>
			</div>
			<div class="pay_item_2">
				
			</div>
		</div>
		<div class="pay_item" style="padding-left:.8em;">
			<div class="pay_item_1">
				收款方
			</div>
			<div class="pay_item_2">
				开摩邦网
			</div>
		</div>
		<div class="pay_item" style="padding:10px 0 10px .8em;">
			<div class="pay_item_1">
				加盟定金(￥)
			</div>
			<div class="pay_item_2">
				<!-- 单位(分) -->
				<select id="sel_money" >
					<option value="100000">1000.00</option>
					<option value="200000">2000.00</option>
					<option value="300000">3000.00</option>
					<%--<option value="1">0.01(测试金额)</option>--%>
				</select>
			</div>
		</div>
		<div class="pay_item">
			<div class="pay_item_1">
				<strong>付款方信息</strong>
			</div>
			<div class="pay_item_2">
				
			</div>
		</div>
		<div class="pay_item " style="padding-left:.8em;">
			<div class="pay_item_1">
				姓名
			</div>
			<div class="pay_item_2">
				${serviceInfo.nickname}
			</div>
		</div>
		<div class="pay_item" style="padding-left:.8em;">
			<div class="pay_item_1">
				手机号
			</div>
			<div class="pay_item_2">
				${serviceInfo.tel}
			</div>
		</div>
		<div id="submit" class="clearfix ">
			<c:choose>
				<c:when test="${empty serviceInfo || empty serviceInfo.wx_open_id }">
					<a class="forbidden">立即支付</a>
				</c:when>
				<c:otherwise>
					<a class="usable" onclick="bargainPay()">立即支付</a>
				</c:otherwise>
			</c:choose>

		</div>
		<c:choose>
			<c:when test="${empty serviceInfo || empty serviceInfo.wx_open_id}">
				<div id="no_register" style="text-align: center;color:red;">
					您还有注册合伙人! <a href="<%=basePath%>api/wx/service/league">[立刻注册]</a>合伙人.
				</div>
			</c:when>
			<c:otherwise>

			</c:otherwise>
		</c:choose>
		<c:if test="${payCount>0}">
			<div id="no_register" style="text-align: center;color:red;" >
				您已经支付过合伙人定金! <span style="color: #0062cc;" onclick="wxPayHistory()">[查看]</span>
			</div>
		</c:if>

	</div>
	</form>

<script>
 function bargainPay(){
	 $("#total_fee").val($("#sel_money").find("option:selected").val());
	 $("#bargainForm").attr("action","<%=basePath%>api/wx/h5pay/bargain");
	 $("#bargainForm").submit();
 }

	function wxPayHistory(){
		window.location.href="<%=basePath%>api/wx/pay/history?user_id=${serviceInfo.sid}&pay_type=bargain"
	}

</script>
</body>
</html>
